from flask import Blueprint, render_template, request

from english_dict import english_dict

dft_blueprint = Blueprint("default", __name__)


@dft_blueprint.route("/index")
def index():
	return "success"


@dft_blueprint.route("/main", methods=["post", "get"])
def main():
	result = ""
	if request.method == "POST":
		keyword = request.form.get("keyword")
		result = english_dict.query(keyword)
	return render_template("main.html", result=result)
